<?php
$this->headTitle('Thành viên','append');
?>
<div class="dashboard-menu dashboard-admin">
    <span class="back">&nbsp;</span>
    <a href="/admin/user"><h1>Thành viên</h1></a>
    <span class="text">Sửa thông tin</span>
</div>
<div class="row placeholders">
    <div class="col-md-12">
        <div class="widget-big">
            <div class="search-result text-left">                                           
                <?php
                    if(isset($this->mess)){
                        if($this->flag == 'success')
                            echo '<div class="bg-success">',$this->mess,'</div>';
                        elseif($this->flag == 'alert')
                            echo '<div class="bg-warning">',$this->mess,'</div>';
                        else
                            echo '<div class="bg-danger">',$this->mess,'</div>';
                    }                    
                    echo $this->form;                                                                               
                ?>                                                                                                                                                                                  
            </div>                    
        </div>
    </div>
</div>
<script type="text/javascript">	
$(document).ready(function(){
    //$("form > dl.zend_form > dd#website-element > input").focus(function(){
        //$(this).val("http://");
    //});
    $("form > dl.zend_form > dd#website-element > input").keyup(function(){                    
        if ($(this).val().length < 7){
            $(this).val("http://");
        }else if($(this).val().indexOf('http://') > 0){                
            this.value = 'http://'+this.value.substr(0,$(this).val().indexOf('http://'));
        }                                     
    });
});
$("form > dl.zend_form > dd#website-element").after(
    '<dt id="logoCur-label"><label class="optional">Logo Công Ty</label></dt>'+
    '<dd id="logoCur-element"><img src="<?=$this->companyCheck["logo"]?>" style="width:100px;height:100px;" title="Hình đại diện" onerror="this.onerror=null;this.src=\'/static/images/noimage.jpg\';"/></dd>'
);
CKEDITOR.replace('intro',{height:500});
function readURL(input) {
    if (input.files && input.files[0]) {
        var reader = new FileReader();
        reader.onload = function (e) {
            $('#logoCur-element img').attr('src', e.target.result);
        }
        reader.readAsDataURL(input.files[0]);
    }
}
$("#logo").change(function(){
    readURL(this);
});
</script>